#include "comm.hpp"

int main() {
    int key = ftok(pathname.c_str(), proj_id);
    int shmid = shmget(key, size, IPC_CREAT|0666);
    char* st = (char*)shmat(shmid, nullptr, 0);

    int fd = open(pipepath.c_str(), O_WRONLY);


    string input = "";
    while (true) {
        getline(cin, input);
        write(fd, "c", 1);
        memcpy(st, input.c_str(), input.size());
    }
    shmdt(st);
}